import { createApp } from 'vue'
import 'element-plus/dist/index.css'
import './style/element_visiable.scss'
import ElementPlus from 'element-plus'
import zhCn from 'element-plus/es/locale/lang/zh-cn'
// 引入封装的router
import router from '@/router/index'
import run from '@/core/race-mweb.js'
import { store } from '@/pinia'
import App from './App.vue'
import WebSocket from "@/utils/web-socket";
const webSocket = new WebSocket(import.meta.env.VITE_WS_PATH)

/**
 * 无需在这块结束，会在路由中间件中结束此块内容
 * */
// markdown 预览 markdown解析需要的配置项目
import VMdPreview from '@kangc/v-md-editor/lib/preview';
// import '@kangc/v-md-editor/lib/style/preview.css'
import githubTheme from '@kangc/v-md-editor/lib/theme/github';
import '@kangc/v-md-editor/lib/theme/style/github.css';
import hljs from 'highlight.js';

VMdPreview.use(githubTheme, {
    Hljs: hljs,
});

const app = createApp(App)
app.config.productionTip = false
app.config.globalProperties.$webSocket = webSocket

app
  .use(run)
  .use(store)
  .use(router)
  .use(VMdPreview)
  .use(ElementPlus, { locale: zhCn })
  .mount('#app')

export default app
